<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
//用户账户表
class Account_model extends CI_Model{
    function __construct() {
        parent::__construct();
        $this->table = 'account';
    }
    
    function get($uid){
        return $this->db->where('user_id',$uid)->get($this->table)->row_array();
    }
    
    function insert($data){
        $this->db->insert($this->table, $data);
        if($this->db->affected_rows()){
            return $this->db->insert_id();
        }else{
            return 0;
        }
    }
    
    function update($data,$user_id){
        return $this->db->where('user_id',$user_id)->update($this->table, $data);
    }
    
    
    
}
